-
Notifications
You must be signed in to change notification settings - Fork 287
Feature/rosbag2 circular logging size duration 2217 #2218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rolling
Are you sure you want to change the base?
Feature/rosbag2 circular logging size duration 2217 #2218
Conversation
Signed-off-by: Luke Sy <[email protected]>
- Add StorageOptions.max_splits (+ YAML/params, Python bindings) - CLI: --max-splits (before size/duration) - Writer: delete oldest files when exceeding size, duration, or split count Signed-off-by: Luke Sy <[email protected]>
Signed-off-by: Luke Sy <[email protected]>
309537d to
7b4c6bb
Compare
Signed-off-by: Luke Sy <[email protected]>
| parser.add_argument( | ||
| '--max-record-size', type=int, default=0, | ||
| help='Maximum total size in bytes for the entire recording across all splits. ' | ||
| 'Oldest bagfiles will be deleted when this limit is exceeded (circular logging). ' | ||
| 'Default: %(default)d, no limit on total recording size. ' | ||
| 'Requires --max-bag-size or --max-bag-duration to be set.') | ||
| parser.add_argument( | ||
| '--max-record-duration', type=int, default=0, | ||
| help='Maximum total duration in seconds for the entire recording across all splits. ' | ||
| 'Oldest bagfiles will be deleted when this limit is exceeded (circular logging). ' | ||
| 'Default: %(default)d, no limit on total recording duration. ' | ||
| 'Requires --max-bag-size or --max-bag-duration to be set.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not against this PR. but i am not sure if those 2 optional arguments need to be supported by rosbag2... because i think those can be easily calculated by --max-splits option above? i think that using --max-splits with --max-bag-size or --max-bag-duration would be more straight-forward for user experience.
besides that,
- (already) too many optional arguments for
ros2 bag record... this generates more and more complication. - additional error handling needs to be implemented in the rosbag2 system. e.g) what if user accidentally set
--max-record-sizewith smaller value than--max-bag-size.
Signed-off-by: Luke Sy <[email protected]>
Signed-off-by: Luke Sy <[email protected]>
30f9f5c to
cf16699
Compare
Signed-off-by: Luke Sy <[email protected]>
|
I've committed changes that should address the unit test error. I'm also happy to include @fujitatomoya ’s suggestion to remove |
Description
Adds circular logging by split count, record size and duration to rosbag2 recording.
--max-splits,--max-record-size,--max-record-duration.Fixes #2217
Is this user-facing behavior change?
Yes.
--max-splits N: limit number of retained bagfile splits.--max-record-size BYTES: limit total recorded size across all splits.--max-record-duration SECONDS: limit total recorded duration across all splits.ros2 bag record -a --max-bag-size 100MB --max-splits 5ros2 bag record -a --max-bag-duration 60 --max-record-size 5_000_000_000ros2 bag record -a --max-bag-size 200MB --max-record-duration 300Did you use Generative AI?
Yes.
Additional Information
--log-levelif needed.metadata.yamlcurrently retains aggregatemessage_countandtopics_with_message_countacross the entire capture, even when older bagfiles are pruned by circular logging. File lists and durations reflect pruning, but those two fields still represent the full session totals.